import { DictVO } from '@/common/vo';
import Axios from '@/utils/request';
import { DataSourceDTO, DataSourceRepVO } from '../vo/data-source';

export default class API {
    /**
     * 查询数据源列表
     * @source 
     */
    static getDataSourceList(data: DataSourceDTO): Promise<DataSourceRepVO> {
        return Axios.post('/audit/dataSource/queryDataSourceList', data)
    }

    /**
     * 新增数据源
     */
    static addDataSource(data: DataSourceDTO): Promise<any> {
        return Axios.post('/audit/dataSource/addDataSourceInfo', data)
    }

    /**
     * 修改数据源
     */
    static editDataSource(data: DataSourceDTO): Promise<any> {
        return Axios.post('/audit/dataSource/updateDataSourceInfo', data)
    }

    /**
     * 删除数据源
     */
    static deleteDataSource(data: string[]): Promise<any> {
        return Axios.post('/audit/dataSource/deleteDataSourceInfo', { idList: data })
    }

    /**
    * 测试连接数据源
    */
    static testLinkData(data: any): Promise<any> {
        return Axios.post('/audit/dataMonitorRule/connTest', data)
    }

    /**
     * 测试连接数据源
     */
    static testLink(data: any): Promise<any> {
        return Axios.post('/audit/dataMonitorRule/connTrial', data)
    }
}
